package yichang;

/**
 * @author A除法
 */
public class Chufa {
//方法加上ｔｈｒｏｗｓ　ｅｘｃｅｐｔｉｏｎ　当调用这个方法的时候，必须加上ｔｒｙ　ｃａｔｃｈ
public  static  int chufa(int x,int y) throws Exception
{
    return  x/y;
}
public  static  int  chufa2(int x,int y) throws Mychufa_yichang {
    if (y == 0) {
        throw new Mychufa_yichang("异常，除数是0");
    }
    return  x/y;
}
}
